﻿@model SuperiorModel.TPagedModelList<SuperiorModel.ProductModel>
<table class="layui-table" id="AppList" lay-filter="test">
    <thead>
        <tr>
            <th>商品ID</th>
            <th>商品名称</th>
            <th>商品品牌</th>
            <th>所属分类</th>
            <th>单位</th>
            <th>排序</th>
            <th>初始销量</th>
            <th>真实销量</th>
            <th>创建时间</th>
            <th>状态</th>
         
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.TList)
        {
        <tr>
            <td>@item.Id</td>
            <td style="width: 160px;">@item.ProductName</td>
            <td>@item.Brand</td>
            <td>@item.MenuName</td>
            <td>@item.Unit</td>
            <td>@item.Sorft</td>
            <td>@item.InitSallNum</td>
            <td>@item.SallCount</td>
            <td>@item.CreateTime</td>
            <td>
                @switch (item.OptionStatus)
                {
                    case 1:
                        <span style="color:green">上架中</span>
                        break;
                    case 0:
                        <span style="color:orangered">下架中</span>
                        break;
                }
            </td>

            <td style="width:20%;">

                @switch (item.OptionStatus)
                {
                    case 1:
                        <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini OptionProduct" href="javascript:void(0);" Opt="0" OptionId="@item.Id">下架</a>
                        break;
                    case 0:
                        <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini OptionProduct" href="javascript:void(0);" Opt="1" OptionId="@item.Id">上架</a>
                        break;
                }

                <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini" href="/Product/ProductEdit?id=@item.Id" MenuName="@item.MenuName">修改</a>
                <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini  DeleteProduct" href="javascript:void(0);" OptionId="@item.Id">删除</a>
                <a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-mini" href="/Product/ProductSku?id=@item.Id" MenuName="@item.MenuName">设置规格</a>
            </td>
        </tr>
        }
    </tbody>
</table>
@Html.Partial("_TPager", Model.PagingResult)